package enum_;

import java.util.Iterator;
import java.util.PriorityQueue;

public class Test {
    public static void main(String[] args) {
        PriorityQueue<Integer> p = new PriorityQueue<>((Integer o1, Integer o2) -> o2.compareTo(o1));
        p.offer(1);
        p.offer(2);
        p.offer(3);
        Iterator<Integer> it = p.iterator();
        while (it.hasNext()) {
            System.out.println(it.next());
        }
    }
}
